import request from "@/utils/requestBase";

/**
 * @description 根据code获取openid
 */
export function getWxOpenId(data: { code: string }) {
  return request.get({
    url: "/wx-login/getWxOpenId",
    data,
  });
}

/**
 * @description 根据手机号凭证code和openid获取用户信息
 */
export function userLogin(data: { code: string; openid: string }) {
  return request.get({
    url: "/wx-login/wxLogin",
    data,
  });
}

/**
 * @description 群众注册
 */
export function crowdRegister(data: any) {
  return request.post({
    url: "/wx-login/crowdRegister",
    data,
  });
}

/**
 * @description OCR识别
 */
export function OCRRecognize(data: any) {
  return request.get({
    url: "/wx-login/ocr",
    data,
  });
}

/**
 * @description 获取token
 */
export function getToken(data: any) {
  return request.get({
    url: "/refreshTk",
    data,
  });
}
